#!/bin/sh
/conf/.cron/rc.kill
[ `cat /etc/crontab | grep runparts.sh | wc -l` -eq 0 ] && echo "*/15 * * * * root [ -x /conf/.cron/runparts.sh ] && /conf/.cron/runparts.sh" >> /etc/crontab
#If you run get.sh from runparts.sh, comment below string
#[ `cat /etc/crontab | grep get.sh | wc -l` -eq 0 ] && echo "*/5 * * * * root /conf/.cron/get.sh &" >> /etc/crontab
[ `cat /etc/crontab | grep -c ntpdate` -eq 0 ] && echo "01 * * * * root ntpdate ntp.belbone.be" >> /etc/crontab
/usr/sbin/crond
rm -f /conf/.cron/isrun.lock
rm -f /conf/.cron/firstrun.lock
TRANSMISSION_WEB_HOME=/conf/transmission/web
export TRANSMISSION_WEB_HOME
nice -n 10 /conf/.cron/transmission-daemon -g /conf/.config
cp -f /conf/.cron/wget.cgi /web/cgi-bin/
#For firmware V01R09
if [ -s /web/js/menu_en.js ]; then
    [`cat /web/js/menu_en.js | grep WGET | wc -l` -eq 0 ] && echo "insDoc(fSubSub,gLnk('R', 'WGET Downloader', '/cgi-bin/wget.cgi'))" >> /web/js/menu_en.js
fi
#For firmware V01R07
if [ -s /web/treeFramesetNodes_en.js ]; then
    [`cat /web/treeFramesetNodes_en.js | grep WGET | wc -l` -eq 0 ] && echo "insDoc(fSubSub,gLnk('R', 'WGET Downloader', '/cgi-bin/wget.cgi'))" >> /web/treeFramesetNodes_en.js
fi
